#include <iostream>
#include <list>
using namespace std;

int main()
{
	int stop, cur;
	cin >> stop;
	list<int> l;
	while (cin >> cur && cur != stop)
		l.push_back(cur);
	l.sort();
	int jug = 0;
	for (auto e : l)
	{
		if (jug) cout << endl; jug = 1;
		cout << e;
	}
	return 0;
}